<?php foreach($comments as $key=>$comment){ ?>	
	<div class="u_buzz_item">
		<div class="u_buzz_item_l">
			<a href="<?php echo Yii::app()->createUrl('profile/index', array('id'=>$comment->user_id));?>">
				<?php if($comment->user->avatar_info){ ?>
					<?php echo $this->material_image('', $comment->user->avatar_info->name, '50', 'photos/'. $comment->user->id . '/' . 0); ?>
				<?php }else{ ?>
					<?php echo $this->material_image('', 'noimage.gif', '50', ''); ?>
				<?php } ?>				
			</a>
		</div>
		<div class="u_buzz_item_r">
			<div class="u_buzz_name">
				<a href="<?php echo Yii::app()->createUrl('profile/index', array('id'=>$comment->user->id));?>">
					<?php echo CHtml::encode($comment->user->full_name); ?>
				</a>
				<?php $date_diff = date_diff(date_create($comment->crdate), date_create()); ?>
				<?php if($date_diff->h){ ?>
					<span class="u_buzz_date"><?php echo Yii::app()->dateFormatter->formatDateTime($comment->crdate, 'long','short'); ?></span>
				<?php }else{ ?>
					<span class="u_buzz_date"><?php echo $date_diff->i; ?> мин. назад</span>
				<?php } ?>
				<div class="u_buzz_link_block hidden">
					<?php if(($comment->user->id == Yii::app()->user->id) || (Yii::app()->user->id == $_GET['id'])){ ?>
						<a href="<?php echo Yii::app()->createAbsoluteUrl("albums/deletecomment", array('comment_id'=>$comment->id)); ?>" class="u_buzz_link l2 comment_delete" onclick="return false;">
							<div class="user_action_item_tooltip c hidden"><div class="cc">Удалить сообщение</div></div>
						</a>
					<?php } ?>
				</div>
			</div>
			<p class="u_buzz_text"><?php echo nl2br(CHtml::encode(rawurldecode($comment->text))); ?></p>
		</div>
	</div>
<?php } ?>
